from flask_script import Manager

from hook.before_request import before_request
from huiyan import create_app
from huiyan.models import create_table

app = create_app()

# def index():
#     return render_template('index.html')

# app.add_url_rule('/', view_func=index)
app.before_request(before_request)

# 初始化命令行模式
manager = Manager(app)

# 创建数据库表结构
create_table(app)

if __name__ == '__main__':
    manager.run()
